package clientApp;

import game.map.MapUnit;

/**
 *
 * @author Gabriel
 */
@SuppressWarnings("serial")
public class MasterPanel2 extends javax.swing.JPanel {

    /** Creates new form MasterPanel1 */
    public MasterPanel2() {
        initComponents();
        initStats();
    }

   	private void initStats() {
		jLabelUnitName.setText("No Unit Select");
		jLabelCurrentHP.setText(" ");
	    jLabelTotalHP.setText(" ");	    
	    jLabelAttBase1.setText(" ");
	    jLabelAttBase2.setText("| ");
	    jLabelAttBase3.setText("| ");
		jLabeAC.setText(" ");
        jLabelWill.setText(" ");
        jLabelRe.setText(" ");
        jLabelFor.setText(" ");
        jLabelInit.setText(" ");
        jLabelPosx.setText(" ");
        jLabelPosy.setText(" ");
	}

   	public void setStats(MapUnit unit)
   	{
   		jLabelUnitName.setText(unit.getUnit().getName());
		jLabelCurrentHP.setText(""+unit.getUnit().getCurrentHP());
	    jLabelTotalHP.setText(""+unit.getUnit().getLifePoints());
	    jLabelAttBase1.setText(" ");
	    jLabelAttBase2.setText("| ");
	    jLabelAttBase3.setText("| ");
	    if(unit.getUnit().getAttackBase().length >= 1)
	    {
	    	jLabelAttBase1.setText("" + unit.getUnit().getAttackBase()[0]);
	    }
	    if(unit.getUnit().getAttackBase().length >= 2)
	    {
	    	jLabelAttBase2.setText("| " + unit.getUnit().getAttackBase()[1]);
	    }
	    if(unit.getUnit().getAttackBase().length == 3)
	    {
	    	jLabelAttBase3.setText("| " + unit.getUnit().getAttackBase()[2]);
	    }	    
		jLabeAC.setText(""+unit.getUnit().getArmorClass());
        jLabelWill.setText(""+unit.getUnit().getWill());
        jLabelRe.setText(""+unit.getUnit().getReflex());
        jLabelFor.setText(""+unit.getUnit().getFortitude());
        jLabelInit.setText(""+unit.getUnit().getInitiative());
        jLabelPosx.setText(""+unit.getX());
        jLabelPosy.setText(""+unit.getY());
   	}
   	
    private void initComponents() {

        jPanel1 = new javax.swing.JPanel();
        jBUnitStats = new javax.swing.JButton();
        jPanel2 = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        jLabelCurrentHP = new javax.swing.JLabel();
        jLabelTotalHP = new javax.swing.JLabel();
        jLabelUnitName = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        jLabel6 = new javax.swing.JLabel();
        jLabel7 = new javax.swing.JLabel();
        jLabelAttBase1 = new javax.swing.JLabel();
        jLabelAttBase2 = new javax.swing.JLabel();
        jLabelAttBase3 = new javax.swing.JLabel();
        jSeparator1 = new javax.swing.JSeparator();
        jLabel8 = new javax.swing.JLabel();
        jLabel9 = new javax.swing.JLabel();
        jLabeAC = new javax.swing.JLabel();
        jLabelWill = new javax.swing.JLabel();
        jLabelRe = new javax.swing.JLabel();
        jLabelFor = new javax.swing.JLabel();
        jLabelInit = new javax.swing.JLabel();
        jLabelPosx = new javax.swing.JLabel();
        jLabelPosy = new javax.swing.JLabel();

        setBackground(new java.awt.Color(0, 0, 102));

        jPanel1.setBackground(new java.awt.Color(0, 0, 102));
        jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "View Stats", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 0, 12), new java.awt.Color(255, 255, 255))); // NOI18N

        jBUnitStats.setText("View Unit Stats");
        

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jBUnitStats, javax.swing.GroupLayout.DEFAULT_SIZE, 136, Short.MAX_VALUE)
                .addContainerGap())
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jBUnitStats)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jPanel2.setBackground(new java.awt.Color(0, 0, 102));
        jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Selected Unit Stats", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 0, 12), new java.awt.Color(255, 255, 255))); // NOI18N

        jLabel1.setFont(new java.awt.Font("Tahoma", 0, 12));
        jLabel1.setForeground(new java.awt.Color(255, 255, 255));
        jLabel1.setText("HP:");

        jLabelCurrentHP.setFont(new java.awt.Font("Tahoma", 0, 12));
        jLabelCurrentHP.setForeground(new java.awt.Color(255, 255, 255));
        jLabelCurrentHP.setText("hps");

        jLabelTotalHP.setFont(new java.awt.Font("Tahoma", 0, 12));
        jLabelTotalHP.setForeground(new java.awt.Color(255, 255, 255));
        jLabelTotalHP.setText("|  hps");

        jLabelUnitName.setFont(new java.awt.Font("Tahoma", 0, 12));
        jLabelUnitName.setForeground(new java.awt.Color(255, 255, 255));
        jLabelUnitName.setText("jLabelCharName");

        jLabel3.setFont(new java.awt.Font("Tahoma", 0, 12));
        jLabel3.setForeground(new java.awt.Color(255, 255, 255));
        jLabel3.setText("Armor Class:");

        jLabel2.setFont(new java.awt.Font("Tahoma", 0, 12));
        jLabel2.setForeground(new java.awt.Color(255, 255, 255));
        jLabel2.setText("Fortitude:");

        jLabel4.setFont(new java.awt.Font("Tahoma", 0, 12));
        jLabel4.setForeground(new java.awt.Color(255, 255, 255));
        jLabel4.setText("Reflex:");

        jLabel5.setFont(new java.awt.Font("Tahoma", 0, 12));
        jLabel5.setForeground(new java.awt.Color(255, 255, 255));
        jLabel5.setText("Will:");

        jLabel6.setFont(new java.awt.Font("Tahoma", 0, 12));
        jLabel6.setForeground(new java.awt.Color(255, 255, 255));
        jLabel6.setText("Initiative:");

        jLabel7.setFont(new java.awt.Font("Tahoma", 0, 12));
        jLabel7.setForeground(new java.awt.Color(255, 255, 255));
        jLabel7.setText("Attack Base:");

        jLabelAttBase1.setFont(new java.awt.Font("Tahoma", 0, 12));
        jLabelAttBase1.setForeground(new java.awt.Color(255, 255, 255));
        jLabelAttBase1.setText("hps");

        jLabelAttBase2.setFont(new java.awt.Font("Tahoma", 0, 12));
        jLabelAttBase2.setForeground(new java.awt.Color(255, 255, 255));
        jLabelAttBase2.setText("|   hps");

        jLabelAttBase3.setFont(new java.awt.Font("Tahoma", 0, 12));
        jLabelAttBase3.setForeground(new java.awt.Color(255, 255, 255));
        jLabelAttBase3.setText("|   hps");

        jLabel8.setFont(new java.awt.Font("Tahoma", 0, 12));
        jLabel8.setForeground(new java.awt.Color(255, 255, 255));
        jLabel8.setText("Pos X:");

        jLabel9.setFont(new java.awt.Font("Tahoma", 0, 12));
        jLabel9.setForeground(new java.awt.Color(255, 255, 255));
        jLabel9.setText("Pos Y:");

        jLabeAC.setFont(new java.awt.Font("Tahoma", 0, 12));
        jLabeAC.setForeground(new java.awt.Color(255, 255, 255));
        jLabeAC.setText("hps");

        jLabelWill.setFont(new java.awt.Font("Tahoma", 0, 12));
        jLabelWill.setForeground(new java.awt.Color(255, 255, 255));
        jLabelWill.setText("hps");

        jLabelRe.setFont(new java.awt.Font("Tahoma", 0, 12));
        jLabelRe.setForeground(new java.awt.Color(255, 255, 255));
        jLabelRe.setText("hps");

        jLabelFor.setFont(new java.awt.Font("Tahoma", 0, 12));
        jLabelFor.setForeground(new java.awt.Color(255, 255, 255));
        jLabelFor.setText("hps");

        jLabelInit.setFont(new java.awt.Font("Tahoma", 0, 12));
        jLabelInit.setForeground(new java.awt.Color(255, 255, 255));
        jLabelInit.setText("hps");

        jLabelPosx.setFont(new java.awt.Font("Tahoma", 0, 12));
        jLabelPosx.setForeground(new java.awt.Color(255, 255, 255));
        jLabelPosx.setText("hps");

        jLabelPosy.setFont(new java.awt.Font("Tahoma", 0, 12));
        jLabelPosy.setForeground(new java.awt.Color(255, 255, 255));
        jLabelPosy.setText("hps");

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jSeparator1, javax.swing.GroupLayout.DEFAULT_SIZE, 136, Short.MAX_VALUE)
                    .addComponent(jLabelUnitName)
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addComponent(jLabel5)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 95, Short.MAX_VALUE)
                        .addComponent(jLabelWill))
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addComponent(jLabel6)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 67, Short.MAX_VALUE)
                        .addComponent(jLabelInit))
                    .addComponent(jLabel7)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
                        .addComponent(jLabelAttBase1)
                        .addGap(18, 18, 18)
                        .addComponent(jLabelAttBase2)
                        .addGap(18, 18, 18)
                        .addComponent(jLabelAttBase3))
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addComponent(jLabel8)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 83, Short.MAX_VALUE)
                        .addComponent(jLabelPosx))
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addComponent(jLabel9)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 82, Short.MAX_VALUE)
                        .addComponent(jLabelPosy))
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addComponent(jLabel1)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 56, Short.MAX_VALUE)
                        .addComponent(jLabelCurrentHP)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jLabelTotalHP))
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addComponent(jLabel4)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 80, Short.MAX_VALUE)
                        .addComponent(jLabelRe))
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addComponent(jLabel3)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 51, Short.MAX_VALUE)
                        .addComponent(jLabeAC))
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addComponent(jLabel2)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 63, Short.MAX_VALUE)
                        .addComponent(jLabelFor)))
                .addContainerGap())
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabelUnitName)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel1)
                    .addComponent(jLabelTotalHP)
                    .addComponent(jLabelCurrentHP))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel3)
                    .addComponent(jLabeAC))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel2)
                    .addComponent(jLabelFor))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel4)
                    .addComponent(jLabelRe))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel5)
                    .addComponent(jLabelWill))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel6)
                    .addComponent(jLabelInit))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jLabel7)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabelAttBase3)
                    .addComponent(jLabelAttBase2)
                    .addComponent(jLabelAttBase1))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel8)
                    .addComponent(jLabelPosx))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel9)
                    .addComponent(jLabelPosy))
                .addContainerGap(92, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jPanel2, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jPanel1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );
    }// </editor-fold>//GEN-END:initComponents

    

    

    // Variables declaration - do not modify//GEN-BEGIN:variables
    public javax.swing.JButton jBUnitStats;
    private javax.swing.JLabel jLabeAC;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JLabel jLabelAttBase1;
    private javax.swing.JLabel jLabelAttBase2;
    private javax.swing.JLabel jLabelAttBase3;
    private javax.swing.JLabel jLabelCurrentHP;
    private javax.swing.JLabel jLabelFor;
    private javax.swing.JLabel jLabelInit;
    private javax.swing.JLabel jLabelPosx;
    private javax.swing.JLabel jLabelPosy;
    private javax.swing.JLabel jLabelRe;
    private javax.swing.JLabel jLabelTotalHP;
    private javax.swing.JLabel jLabelUnitName;
    private javax.swing.JLabel jLabelWill;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JSeparator jSeparator1;
    // End of variables declaration//GEN-END:variables
}
